$sideBarWidth: 210px;
/* 侧边栏背景 */
$sidebarBg: #001529 !default;

/* 菜单选中后字体样式 */
$subMenuActiveText: #fff !default;

/* 菜单背景 */
$menuBg: #001529 !default;

/* 鼠标覆盖到菜单时的背景 */
$menuHover: #4091f7 !default;

/* 子菜单背景 */
$subMenuBg: #0f0303 !default;

/* 有无子集的激活菜单背景 */
$subMenuActiveBg: #4091f7 !default;
$navTextColor: #fff !default;
$menuText: rgba(254, 254, 254, 0.65) !default;

/* logo背景颜色 */
$sidebarLogo: #002140 !default;

/* 鼠标覆盖到菜单时的字体颜色 */
$menuTitleHover: #fff !default;
$menuActiveBefore: #4091f7 !default;


.app-wrapper{
  position: relative;
  width: 100%;
  height: 100%;
  // 隐藏侧边栏与header栏模式
  &.hidden-mode{
    // 侧边栏折叠模式
    &.foldSidebar{
      .sidebar-container{
        width: 64px !important;
        left:-64px;
      }
    }
    // 侧边栏展开模式
    &.unfoldSidebar{
      .sidebar-container{
        width: $sideBarWidth;
        left:-$sideBarWidth;
      }
    }
    .main-container{
      padding-left: 0;
      .fixed-header{
        left:0;
        top: -48px;
      }
      .fixed-tag{
        left:0;
        top:0;
      }
      .app-main{
        padding-top: 38px;
      }
    }
  }
  // 显示侧边栏与header栏模式
  &.show-mode{
    // 侧边栏折叠模式
    &.foldSidebar{
      .sidebar-container{
        width: 64px !important;
      }
      .main-container{
        padding-left: 64px;
        .fixed-header{
          left:64px;
        }
        .fixed-tag{
          left:64px;
        }
      }
    }
    // 侧边栏展开模式
    &.unfoldSidebar{
      .sidebar-container{
        width: $sideBarWidth;
      }
      .main-container{
        padding-left: $sideBarWidth;
        .fixed-header{
          left:$sideBarWidth;
        }
        .fixed-tag{
          left:$sideBarWidth;
        }
      }
    }
    .sidebar-container{
      left: 0;
    }
    .main-container{
      .fixed-header{
        top: 0;
      }
      .fixed-tag{
        top:48px;
      }
      .app-main{
        padding-top: 86px;
      }
    }
  }
  .sidebar-container {
    transition: all 0.28s;
    background-color: $sidebarBg;
    height: 100%;
    position: fixed;
    font-size: 0;
    bottom: 0;
    z-index: 1001;
    overflow: hidden;
    box-shadow: 0 0 1px #888;
    top: 0;
  }
  .main-container {
    min-height: 100%;
    transition: padding-left .28s;
    position: relative;
    background: #f0f2f5;
    .fixed-header,.fixed-tag{
      background: #fff;
      box-shadow: 0 0 1px rgba(0,0,0,.3);
      transition: all 0.28s;
      position: fixed;
      right: 0;
      z-index: 1000;
    }
    .fixed-header {
      height: 48px;
    }
    .fixed-tag{
      height: 38px;
    }
    .app-main{
      width: 100%;
      height: 100vh;
      position: relative;
      overflow: hidden;
      .app-root{
        width:100%;
        height: 100vh;
        overflow-x: hidden;
        position: relative;
      }
    }
  }  
}
// 菜单默认样式优化
.sidebar-container{
  .logo {
    position: relative;
    width: 100%;
    height: 48px;
    overflow: hidden;
    .logo-link {
      display: inline-block;
      width: 100%;
      height: 100%;
      text-align: left;
      padding-left: 8px;
      .logo-img{
        width: 32px;
        height: 32px;
        display: inline-block;
        margin: 8px;
        vertical-align: top;
      }
      .logo-title {
        display: inline-block;
        margin: 0;
        color: #1890ff;
        font-weight: 600;
        font-size: 20px;
        line-height: 24px;
        margin-top: 12px;
        vertical-align: top;
      }
    }
  }
  .menu-scroll{
    position: absolute;
    left:0;
    top: 48px;
    bottom:0;
    width: 100%;
    .el-scrollbar{
      .scrollbar-wrapper {
        overflow-x: hidden !important;
      }
    }
  }
  .router-menu{
    border: none;
    height: 100%;
    background-color: transparent !important;
    .el-icon{
      display: inline-block;
      width: 24px;
      height: 24px;
      line-height:0;
      font-size:0;
      vertical-align: middle;
      margin-right: 10px;
      text-align: center;
      padding:3px;
      svg{
        width: 1em !important;
        height: 1em !important;
        font-size: 18px !important;
        text-align: center;
        vertical-align: middle;
        line-height: 0;
        display: inline-block;
      }
    }
    .el-menu-item{
      display: flex; 
      align-items: center;
      >.menu-title{
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
        >span{
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }
    }
    .el-sub-menu{
      .el-sub-menu__title{
        padding-right: 44px!important;
        >.menu-title{
          display: flex;
          flex: 1;
          align-items: center;
          justify-content: space-between;
          overflow: hidden;
          >span{
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }
      }
    }
    
    .el-sub-menu__icon-arrow{
      position: absolute !important;
      margin-right:0!important;
      width: 14px!important;
      height: 14px!important;
      padding:1px!important;
      visibility: inherit;
      right: inherit;
      left: calc($sideBarWidth - 14px - 20px);
      transition: all 0.28s linear .28s;
      svg{
        width: 1em !important;
        height: 1em !important;
        font-size: 12px !important;
        text-align: center;
        vertical-align: middle;
        line-height: 0;
        display: inline-block;
      }
    }
  
    .el-menu-item,
    .el-sub-menu__title {
      color: $menuText;
    }
  
    // menu hover
    .root-menu-noDropdown,
    .el-sub-menu__title {
      // background: $menuBg;
      &:hover {
        background-color: $menuHover !important;
      }
    }
  
    .is-active > .el-sub-menu__title,
    .is-active.root-menu-noDropdown,
    .router-link-active .root-menu-noDropdown {
      color: $subMenuActiveText !important;
      i {
        color: $subMenuActiveText !important;
      }
    }
  
    .is-active {
      transition: color 0.3s;
      color: $subMenuActiveText !important;
    }
  
    .el-menu--inline .el-sub-menu__title,
    .el-sub-menu .el-menu-item {
      font-size: 12px;
      min-width: $sideBarWidth !important;
      background-color: $subMenuBg !important;
    }
  
    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }
  }
}
.el-popper{
  .menu-title{
    display: inline-block;
  }
}

// 侧边导航折叠时
.foldSidebar{
  .logo{
    .logo-link{
      .logo-title{
        visibility: hidden;
        transform: scale(0);
      }
    }
  }
  .root-menu-noDropdown {
    padding: 0 !important;
    position: relative;
  }
  .el-sub-menu {
    overflow: hidden;
    & > .el-sub-menu__title {
      .el-sub-menu__icon-arrow {
          margin-top: -7px!important;
          display: inline-block!important;
          visibility: hidden;
      }
    }
  }
  // 菜单折叠
  .el-menu--collapse {
    width: 64px !important;
    .el-tooltip__trigger{
      display: flex!important;
      align-items: center!important;
    }
    .el-sub-menu {
      & > .el-sub-menu__title {
        & > span {
          height: 0;
          width: 0;
          overflow: hidden;
          visibility: hidden;
          display: inline-block;
        }
      }
    }
    .root-menu-noDropdown {
      background: transparent !important;
    }
  }
}
// 侧边导航折叠时子菜单样式 
.el-menu--vertical{
  .el-menu--popup {
    background-color: $subMenuBg !important;
    .el-menu-item {
      span {
        font-size: 12px;
      }
    }
    .el-sub-menu__title {
      color: $menuText;
      padding-right: 50px!important;
    }
  }

  .is-active > .el-sub-menu__title,
  .is-active.root-menu-noDropdown,
  .router-link-active .root-menu-noDropdown {
    color: $subMenuActiveText !important;
    i {
      color: $subMenuActiveText !important;
    }
  }

  /* 子菜单中还有子菜单 */
  .el-menu .el-sub-menu__title {
    font-size: 12px;
    min-width: $sideBarWidth !important;
    background-color: $subMenuBg !important;
  }

  .el-menu-item,
  .el-sub-menu__title {
    height: 50px;
    line-height: 50px;
    color: $menuText;
    background-color: $subMenuBg;
    &:hover {
      color: $menuTitleHover !important;
    }
  }

  .is-active {
    transition: color 0.3s;
    color: $subMenuActiveText !important;
  }

  .el-menu-item.is-active.nest-menu {
    background: $subMenuActiveBg !important;
  }

  .el-menu-item,
  .el-sub-menu {
    .el-sub-menu__icon-arrow {
      width: 20px;
      text-align: center;
      font-size: 16px;
      margin-top:-8px;
    }
  }
} 
// 顶部header样式
.header {
  width: 100%;
  height: 48px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  display: flex;
  justify-content:space-around;
  align-items:center;
  .header-left{
    display: flex;
    align-items: center;
    .hamburger-container {
      line-height: 48px;
      height: 100%;
      cursor: pointer;
      transition: background 0.3s;
      -webkit-tap-highlight-color: transparent;
      &:hover {
        background: rgba(0, 0, 0, 0.025);
      }
    }
    .breadcrumb-container {
      flex:1;
      height:48px;
      white-space: nowrap;
      font-size: 14px;
      line-height: 48px;
      position: relative;
      .no-redirect {
        color: #97a8be;
        cursor: text;
      }
      .el-breadcrumb__item{
        float:none;
        display: inline-block;
      }
    }
  }
  .header-center{
    flex:1;
    align-items: center;
  }
  .header-right {
    display: flex;
    min-width: 280px;
    height: 48px;
    align-items: center;
    color: rgba(0,0,0,.9);
    justify-content: flex-end;
  }
}
// 折叠按钮组件
.hamburger{
  padding: 0 15px;
  .el-icon{
    display: inline-block;
    vertical-align: middle;
    line-height:0;
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #333;
    .svg-icon{
      transform: rotate(180deg);
    }
    .is-active {
      transform: rotate(0);
    }
  }
}

.header-right {
  display: flex;
  min-width: 280px;
  height: 48px;
  align-items: center;
  color: rgba(0,0,0,.9);
  justify-content: flex-end;
  .el-dropdown-link {
    height: 48px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    cursor: pointer;
    color: rgba(0,0,0,.9);
    &:hover {
      background: #f6f6f6;
    }
    p {
      font-size: 14px;
    }
    img {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      margin-right: 10px;
    }
  }
  .screen-full {
    width: 36px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    cursor: pointer;
    &:hover {
      background: #f6f6f6;
    }
  }
}

.logout {
  max-width: 120px;
  .el-dropdown-menu__item {
    min-width: 100%;
    display: inline-flex;
    flex-wrap: nowrap;
    padding: 0 18px !important;
    height: 22px;
    line-height: 0;
    vertical-align: middle;
    span{
      height: 22px;
      line-height: 22px;
    }
    .icon-span{
      width: 22px;
      text-align: center;
      line-height: 22px;
      vertical-align: middle;
      i{
        margin:4px;
      }
    }
    .txt-span{
      flex: 1;
    }
  }
  .el-dropdown-menu__item:focus,
  .el-dropdown-menu__item:not(.is-disabled):hover {
    color: #606266;
    background: #f0f0f0;
  }
}

// 标签页样式
.tags-view {
  width: 100%;
  font-size: 14px;
  display: flex;
  align-items: center;
  color: var(--el-text-color-regular);
  background: #fff;
  position: relative;
  >.el-icon{
    width: 40px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    font-size: 16px;
    color: rgba(0,0,0,.7);
    &.btn-left{
      box-shadow: 5px 0 5px -6px #ccc;
      &:hover {
        cursor: w-resize;
      }
    }
    &.btn-right{
      border-right: 1px solid rgba(0,0,0,.1);
      box-shadow: -5px 0 5px -6px #ccc;
      &:hover {
        cursor: e-resize;
      }
    }
  }
  .scroll-container {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    .tab {
      position: relative;
      float: left;
      list-style: none;
      overflow: visible;
      white-space: nowrap;
      transition: transform 0.5s ease-in-out;
      .scroll-item {
        padding: 0 15px;
        position: relative;
        height: 38px;
        display: inline-block;
        line-height: 38px;
        border-right: 1px solid rgba(0,0,0,.1);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        .link-span {
          text-decoration: none;
          color: #666;
          padding: 0 4px 0 4px;
        }
        >.el-icon{
          width: 16px;
          height: 16px;
          font-size: 10px;
          cursor: pointer;
          position: absolute;
          top: 50%;
          transform: translate(0, -50%);
          border-radius: 50%;
          transition: all 0.28s;
          &:hover {
            border-radius: 50%;
            color: #fff;
            background: #b4bccc;
            font-size: 12px;
          }
        }
        &.is-active {
          position: relative;
          &:not(:first-child) {
            padding-right: 32px;
          }
          >.el-icon {
            transform: translate(0, -50%);
          }
          .link-span {
            color: var(--el-color-primary);
          }
        }
        &.card-in {
          color: var(--el-color-primary);
          .link-span {
            color: var(--el-color-primary);
          }
        }
        &.card-out {
          color: #666;
          .link-span {
            color: #666;
          }
        }
        &:not(:first-child) {
          &:hover {
            padding-right: 32px;
            &:not(.is-active) {
              >.el-icon {
                animation: close 200ms ease-in forwards;
              }
            }
          }
        }
      }
    }
  }
  .right-button {
    display: flex;
    font-size: 16px;
    li {
      display: flex;
      align-items: center;
      justify-content: center;
      border-right: 1px solid rgba(0,0,0,.1);
      cursor: pointer;
      .el-icon{
        width: 40px;
        height: 38px;
      }
    }
  }
  /* 右键菜单 */
  .contextmenu {
    margin: 0;
    background: #fff;
    position: absolute;
    list-style-type: none;
    padding: 5px 0;
    border-radius: 4px;
    color: rgba(0,0,0,.9);
    font-weight: normal;
    font-size: 13px;
    white-space: nowrap;
    outline: 0;
    box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
    li {
      width: 100%;
      margin: 0;
      padding: 7px 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      &:hover {
        background: #eee;
      }
      .el-icon{
        width: 14px;
        height: 14px;
        font-size: 14px;
        margin-right: 0.5em;
      }
    }
  }
}

.vk-right-button {
  display: flex;
  font-size: 16px;
  border-left: 1px solid var(--el-border-color-lighter);

  li {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--el-border-color-lighter);
    cursor: pointer;

    .el-icon {
      width: 40px;
      height: var(--el-tag-height);

      &:hover {
        color: var(--el-color-primary);
      }
    }
  }
}

/* 标签栏刷新按钮动画效果 */
.refresh-button {
  -webkit-animation: rotate 600ms linear infinite;
  -moz-animation: rotate 600ms linear infinite;
  -o-animation: rotate 600ms linear infinite;
  animation: rotate 600ms linear infinite;
}
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

// 标签栏关闭按钮动画效果
@keyframes close {
  from {
    transform: translate(-50%, -50%);
  }
  to {
    transform: translate(0, -50%);
  }
}